package Controlador;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

import Modelo.mProdxIngre;

public class cIngrexProd {
	public void limpiar(JLabel jLabel5,JLabel jLabel6,JComboBox jComboBox1,JComboBox jComboBox2,JTextField jTextField1,JButton jButton1,JButton jButton4)
	{
		jLabel5.setVisible(false);
		jLabel6.setVisible(false);
		jComboBox1.setSelectedItem(0);
		jComboBox2.setSelectedItem(0);
		jTextField1.setText("");
		//jLabel5.setText("");
		jLabel6.setText("");
		jButton1.setEnabled(true);
		jButton4.setEnabled(true);	
		jTextField1.setEnabled(true);
	}
	public void guardar(JLabel jLabel5,JLabel jLabel6,JComboBox jComboBox1,JComboBox jComboBox2,JTextField jTextField1,JButton jButton1,JButton jButton4)
	{
		mProdxIngre tProdxIngre = new mProdxIngre();
		tProdxIngre.setCodProd(Integer.parseInt(jLabel5.getText()));
		tProdxIngre.setCodIngre(Integer.parseInt(jLabel6.getText()));
		tProdxIngre.setCantidad(Double.parseDouble(jTextField1.getText()));
		tProdxIngre.guardar();
		JOptionPane.showMessageDialog(null, "Actualizacion Completa");
		limpiar(jLabel5,jLabel6,jComboBox1,jComboBox2,jTextField1,jButton1,jButton4);
	}
}
